#pragma once

#include "Gameplay_States/IGameState.h"
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <list>
#include "SGD Wrappers/CSGD_Direct3D.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include "SGD Wrappers/CSGD_Direct3D.h"
#include "SGD Wrappers/CSGD_DirectInput.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include "SGD Wrappers/CSGD_XAudio2.h"

class CGame
{
public:
	CGame	(void);
	~CGame	(void);
	static CGame* GetInstance( void );
	void Initialize( HWND hWnd, HINSTANCE hInstance,
					 int nScreenWidth, int nScreenHeight,
					 bool bIsWindowed );
	bool Main(void);
	void Shutdown(void);
	void AddState(IGameState* pNextState);
	void RemoveState(IGameState* pStateToBeRemoved);
	int		GetWidth(void) const	{ return m_nWidth;		}
	int		GetHeight(void) const	{ return m_nHeight;		}

	bool IsWindowed(void) const{ return m_bIsWindowed;}

private:
	bool Input( void );
	void Update( void );
	void Render( void );
	int						m_nWidth;
	int						m_nHeight;
	bool					m_bIsWindowed;
	DWORD					m_dwCurrTime;

	IGameState*				m_pCurrState;
	IGameState*				m_pPrevState;

	typedef std::list<IGameState*>	ListOfGameStates;
	typedef ListOfGameStates::iterator GameIter;
	ListOfGameStates m_lGames;

	CSGD_DirectInput* m_pDI;
	CSGD_Direct3D* m_pD3D;
	CSGD_TextureManager* m_pTM;
	CSGD_XAudio2* m_pXA;

};